#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define D long double
#define N 400005
#define mod 1000000007
#define int long long
int dp[N];
signed main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int x,y;cin>>x>>y;dp[x]=1;
	for(int i=x;i<=y;i++){
		dp[i*2]+=dp[i];dp[i*2]%=mod;
		dp[i+1]+=dp[i];dp[i+1]%=mod;
	}
	cout<<dp[y];
	return 0;
}
